#include "TaskAgricul.h"
#include "Building/City.h"
#include "Sprite/Knight.h"
#include "Master.h"
#include "Widget.h"

TaskAgricul::TaskAgricul()
{
}

bool TaskAgricul::Init(City *city, Knight *knight, QDate assinDate, int preDays)
{
    Task::Init(assinDate,preDays);
    this->m_city=city;
    this->m_knight=knight;
    this->m_taskType=FlgTaskAgricul;

    return true;
}

void TaskAgricul::taskProcess()
{
    double d=this->m_knight->getStrenth()*10;
    this->m_city->setAgricul(this->m_city->getAgricul()+d);
    Widget *widget=Master::getMaster()->getWidget();
    widget->updateTaskMsgStatus(this->m_city->getName(),this->m_knight->getName(),"nonye",QString::number(d));
}
